<template>
    <div>

    </div>
</template>

<script>
    export default {
        name: "BaseEdit",
        data(){
            return {formData:{} }
        },
        methods:{
            load(url,data,callback){
                this.formData={};
                this.spinShow=true;
                this.$axios.post(url,this.$qs.stringify(data)).then(res=>{
                    let code = res.data.code;
                    let data = res.data.data;
                    if(code==200){
                        this.formData=data;
                        this.spinShow=false;
                        if(callback!=null){
                            callback();
                        }
                    }else{
                        this.$Message.error(data.msg);
                    }
                }).catch(()=>{
                    this.$Message.error('服务器未响应!');
                });
            }
        }
    }
</script>

<style scoped>

</style>
